<?php #coding: utf-8 æ ø å ?

class Guide extends CI_Controller {

	function __construct()
	{
	parent::__construct();
	$this->is_logged_in();
	}


	public function rettighedssystem(){
		$this->load->model('rollespiller_model');
		
		
		//print_r($data['alle_beskrivelser']);
		$data['deltager'] = $this->session->userdata('deltager');
		$data['ingame'] = $this->session->userdata('ingame');
		
		// BOGMÆRKER HENTES IND
		$data['bookmarks'] = $this->rollespiller_model->find_bookmarks($data['deltager']['userid']);
		
		
		$data['overskrift_right'] = "TAOC's rettighedssystem";		

		
		$data['content_right'][] = "user_guide/rettighedssystem/hovedside_right";
		$data['content_left'][] = "user_guide/rettighedssystem/hovedside_left";
		$this->load->view('includes/templates/bogpaapult.php',$data);
	}

	public function almanak(){	
		
		$this->load->model('rollespiller_model');
		
		$data['deltager'] = $this->session->userdata('deltager');
		
		
		// BOGMÆRKER HENTES IND
		$data['bookmarks'] = $this->rollespiller_model->find_bookmarks($data['deltager']['userid']);

		
		$data['overskrift_right'] = "Guide til Almanak";		
		$data['sidehoved_right'] = "almanak/sidehoved_right";
		$data['sidehoved_left'] = "almanak/sidehoved_left";
		$data['popup'] = "user_guide/popup/intro_almanak";
		$data['content_right'][] = "user_guide/almanak/forklaring_right";
		//$data['content_right'][] = "user_guide/WYSIWYG/ny";
		$data['content_left'][] = "user_guide/almanak/forklaring_left";
		$this->load->view('includes/templates/bogpaapult.php',$data);
	}


	function is_logged_in()
	{
		// Definerer session med $is_logged_in
		$deltager = $this->session->userdata('deltager');
		$ingame = $this->session->userdata('ingame');


			//echo "deltager er "; print_r($deltager);
			//echo "ingame er "; print_r($ingame);

		if(empty($deltager) or empty($ingame))
		{



            $redirect['url'] = $this->uri->uri_string();
            $redirect['side'] = $this->uri->segment(5);
	    	$this->session->set_userdata('redirect', $redirect);      
			// Viser header, tilskuer.php med besked om "at det ikke lykkedes at blive deltager" og footer 
            

			redirect('login');
		
		 		
		}
	}




}

?>
